// 用户管理接口api
import { fetch } from '@/utils/fetch.js';
// 刷新当前的token
export function userRefreshToken(params) {
  return fetch({
    url: '/usercenter/sys/user/refreshToken',
    method: 'POST',
    data: params,
  });
}
// 获取学生列表
export function getStudentList(params) {
  return fetch({
    url: '/questionlib/nice/student/getstudents',
    method: 'POST',
    data: params,
  });
}

// 新增学生
export function addStudent(params) {
  return fetch({
    url: '/usercenter/operation/student/addStudent',
    method: 'POST',
    data: params,
  });
}

// 删除学生
export function deleteStudent(params) {
  return fetch({
    url: '/usercenter/operation/student/delete',
    method: 'POST',
    data: params,
  });
}

// 学生异步导出
export function exportDataAsync(params) {
  return fetch({
    url: '/questionlib/bussiness/userMangement/exportDataAsync',
    method: 'POST',
    data: params,
  });
}

// 导出异步获取结果
export function exportQueryList(params) {
  return fetch({
    url: '/usercenter/operation/export/queryList',
    method: 'POST',
    data: params,
  });
}
// 添加学生的联系人
export function addContracts(params) {
  return fetch({
    url: '/questionlib/nice/student/addcontacts',
    method: 'POST',
    data: params,
  });
}
// 根据id获取学生详细信息
export function getLearningExperience(params) {
  return fetch({
    url: '/questionlib/nice/learningExperience/getByUserId',
    method: 'POST',
    data: params,
  });
}
// 根据学生id获取学习经历
export function getStudentDetailById(params) {
  return fetch({
    url: '/questionlib/nice/student/getstudentbyId',
    method: 'POST',
    data: params,
  });
}

// 学生列表导出
export function exportData(params) {
  return fetch({
    url: '/questionlib/bussiness/userMangement/exportData',
    method: 'POST',
    data: params,
    responseType: 'blob',
  });
}

// 根据学生id获取订单信息
export function getOrderListById(params) {
  return fetch({
    url: '/questionlib/nice/order/getByUserId',
    method: 'POST',
    data: params,
  });
}
// 根据课程ID获取其所有的期次
export function getCoursePeriodList(params) {
  return fetch({
    url: '/questionlib/nice/course/getallperiodbycourseid',
    method: 'POST',
    data: params,
  });
}
// 根据期次ID获取所有的班级
export function getAllClassByPeriodId(params) {
  return fetch({
    url: '/questionlib/nice/class/getAllClassesByPeriodId',
    method: 'POST',
    data: params,
  });
}
// 调班或者批量调班
export function adjustClass(params) {
  return fetch({
    url: '/usercenter/operation/course/changeClass',
    method: 'POST',
    data: params,
  });
}

// 调期或者批量调期
export function adjustPeriod(params) {
  return fetch({
    url: '/usercenter/operation/course/changePeriod',
    method: 'POST',
    data: params,
  });
}

// 更换辅导老师
export function changeTutor(params) {
  return fetch({
    url: '/usercenter/operation/course/changeTutor',
    method: 'POST',
    data: params,
  });
}
// 增加班级
export function addClass(params) {
  return fetch({
    url: '/questionlib/nice/class/addclass',
    method: 'POST',
    data: params,
  });
}

// 删除班级
export function deleteClass(params) {
  return fetch({
    url: '/questionlib/nice/class/deleteclass',
    method: 'POST',
    data: params,
  });
}

// 查询线下学校
export function querySchool(params) {
  return fetch({
    url: '/questionlib/nice/school/querySchool',
    method: 'POST',
    data: params,
  });
}

// 编辑学校
export function editSchool(params) {
  return fetch({
    url: '/usercenter/operation/school/edit',
    method: 'POST',
    data: params,
  });
}

// 获取年级下班级列表
export function getClassList(params) {
  return fetch({
    url: '/usercenter/operation/school/getClassList',
    method: 'POST',
    data: params,
  });
}

// 分页获取学生信息（新）
export function getStudentListByCondition(params) {
  return fetch({
    url: '/usercenter/operation/school/getStudentListByCondition',
    method: 'POST',
    data: params,
  });
}

// 学生微信状态编辑
export function updateStudentWechatStatus(params) {
  return fetch({
    url: '/usercenter/operation/school/updateStudentWechatStatus',
    method: 'POST',
    data: params,
  });
}

// 新增班级
export function addSchoolClass(params) {
  return fetch({
    url: '/usercenter/operation/school/addClass',
    method: 'POST',
    data: params,
  });
}
// 学校公校报课列表
export function queryCoursePlanList(params) {
  return fetch({
    url: '/usercenter/operation/school/queryCoursePlanList',
    method: 'POST',
    data: params,
  });
}

// 获取学校阶段对应年级
export function getGrade(params) {
  return fetch({
    url: '/usercenter/operation/school/getGrade',
    method: 'POST',
    data: params,
  });
}

// 获取分配辅导列表
export function getAssignsTutorQuery(params) {
  return fetch({
    url: '/usercenter/operation/course/assignsTutorQuery',
    method: 'POST',
    data: params,
  });
}

// 获取所有辅导老师
export function queryCounselorList(params) {
  return fetch({
    url: '/usercenter/operation/school/queryCounselorList',
    method: 'POST',
    data: params,
  });
}

// 针对学校新增学生
export function addSchoolStudent(params) {
  return fetch({
    url: '/usercenter/operation/schoolStudent/add',
    method: 'POST',
    data: params,
  });
}

// 根据年级搜索商品列表
export function queryGoodsListByTerm(params) {
  return fetch({
    url: '/usercenter/operation/school/queryGoodsListByTerm',
    method: 'POST',
    data: params,
  });
}

// 生成年级报课以及报课详情记录
export function insertCoursePlanAndDetail(params) {
  return fetch({
    url: '/usercenter/operation/school/insertCoursePlanAndDetail',
    method: 'POST',
    data: params,
  });
}

// 编辑年级报课
export function editCoursePlanAndDetail(params) {
  return fetch({
    url: '/usercenter/operation/school/editCoursePlanAndDetail',
    method: 'POST',
    data: params,
  });
}

// 获取学校公校报课详情
export function queryCoursePlanDetails(params) {
  return fetch({
    url: '/usercenter/operation/school/queryCoursePlanDetails',
    method: 'POST',
    data: params,
  });
}
// 是否开启和关闭学校公校报课
export function isCloseCoursePlan(params) {
  return fetch({
    url: '/usercenter/operation/school/isCloseCoursePlan',
    method: 'POST',
    data: params,
  });
}

// 删除学校公开课
export function deletedCoursePlanById(params) {
  return fetch({
    url: '/usercenter/operation/school/deletedCoursePlanById',
    method: 'POST',
    data: params,
  });
}

// 模糊查询线下学校
export function queryPageList(params) {
  return fetch({
    url: '/questionlib/nice/school/queryPageList',
    method: 'POST',
    data: params,
  });
}

// 报名
export function buyCourse(params) {
  return fetch({
    url: '/usercenter/operation/student/buyCourse',
    method: 'POST',
    data: params,
  });
}
// 获取课程详情列表
export function getPeriodDetail(params) {
  return fetch({
    url: '/questionlib/nice/period/perioddetail',
    method: 'POST',
    data: params,
  });
}

// 获取所有的课程
export function getAllCourse(params) {
  return fetch({
    url: '/questionlib/nice/course/queryList',
    method: 'POST',
    data: params,
  });
}

// 根据期次分页获取班级信息
export function getClassByPeriodId(params) {
  return fetch({
    url: '/questionlib/nice/period/queryclass',
    method: 'POST',
    data: params,
  });
}

// 根据班级ID分页获取学生信息
export function getStudentByClassId(params) {
  return fetch({
    url: '/questionlib/nice/student/getStudentByClassId',
    method: 'POST',
    data: params,
  });
}

// 新增学校
export function addSchool(params) {
  return fetch({
    url: '/usercenter/admin/school/add',
    method: 'POST',
    data: params,
  });
}
// 更新学校
export function adminschoolupdate(params) {
  return fetch({
    url: '/usercenter/admin/school/update',
    method: 'POST',
    data: params,
  });
}
// 获取届数与届数下的班级
export function getGraduates(params) {
  return fetch({
    url: '/questionlib/nice/school/getGraduates',
    method: 'POST',
    data: params,
  });
}
// 调班
export function changeClass(params) {
  return fetch({
    url: '/questionlib/nice/class/changeclass',
    method: 'POST',
    data: params,
  });
}

// 分班
export function distributionClass(params) {
  return fetch({
    url: '/questionlib/nice/class/distributionclass',
    method: 'POST',
    data: params,
  });
}
// 根据学校id获取学校的基本信息
export function getSchoolDetails(params) {
  return fetch({
    url: '/usercenter/admin/school/info',
    method: 'POST',
    data: params,
    // restype: "form"
  });
}
// 根据学校导出学生信息
export function exportStudent(params) {
  return fetch({
    url: '/usercenter/admin/export/school/student',
    method: 'GET',
    data: params,
    responseType: 'blob',
  });
}
// 根据学校导出学生信息id
export function adminexportschoolclass(params) {
  return fetch({
    url: '/usercenter/admin/export/school/class',
    method: 'GET',
    data: params,
    responseType: 'blob',
  });
}
// // 数据上报
// export function nxeduJwgljl(params) {
//     return fetch({
//         url: '/givelesson/nxedu/teacher/jwgljl',
//         method: 'POST',
//         data: params
//     })
// }
// 报名回调
export function batchNotify(params) {
  return fetch({
    url: '/questionlib/pay/zero/notify',
    method: 'POST',
    data: params,
  });
}
// 根据校长ID获取校长的基本信息
export function getPrincipalInfo(params) {
  return fetch({
    url: '/questionlib/nice/school/getprincipalinfo',
    method: 'POST',
    data: params,
  });
}

// 新增校长
export function addPrincipalInfo(params) {
  return fetch({
    url: '/usercenter/admin/school/master/save',
    method: 'POST',
    data: params,
  });
}

// 根据老师id获取信息
export function queryAutoSqlOne(params) {
  return fetch({
    url: '/usercenter/core/tableRecord/queryAutoSqlOne',
    method: 'POST',
    data: params,
  });
}

// 分页获取员工列表
export function getStaffList(params) {
  return fetch({
    url: '/usercenter/router/staffmanagement/pagequerystaff',
    method: 'POST',
    data: params,
  });
}
// 根据员工id获取员工详情
export function getStaffDetail(params) {
  return fetch({
    url: '/usercenter/router/innerUser/getInfoById',
    method: 'POST',
    data: params,
  });
}
// 根据员工id获取教学信息
export function getStaffTeachInfo(params) {
  return fetch({
    url: '/usercenter/core/tableRecord/queryOne',
    method: 'POST',
    data: params,
  });
}

// 根据员工id分页获取教学经历
export function getTeachExperienceById(params) {
  return fetch({
    url: '/questionlib/nice/teachingExperience/getByteacheId',
    method: 'POST',
    data: params,
  });
}

// 根据员工id分页获取班级信息
export function getClassInfoByTutorId(params) {
  return fetch({
    url: '/questionlib/nice/classes/getByTutorId',
    method: 'POST',
    data: params,
  });
}

// 根据员工id分页获取课件信息
export function getCourseWare(params) {
  return fetch({
    url: '/questionlib/nice/courseWare/list',
    method: 'POST',
    data: params,
  });
}

// 根据员工id分页获取学校信息-销售
export function getSchoolBySalesId(params) {
  return fetch({
    url: '/questionlib/nice/school/getByMarketId',
    method: 'POST',
    data: params,
  });
}

// 根据员工id分页获取学校信息-运营
export function getByOperationId(params) {
  return fetch({
    url: '/questionlib/nice/school/getByOperationId',
    method: 'POST',
    data: params,
  });
}

// 组织架构
// 增加下级
export function addSubordinate(params) {
  return fetch({
    url: '/usercenter/router/orgnazation/addsubordinate',
    method: 'POST',
    data: params,
  });
}
// 根据部门/角色ID账号或姓名搜索用户
export function getOrganizationalStructureQry(params) {
  return fetch({
    url: '/usercenter/operation/management/organizationalStructureQry',
    method: 'POST',
    data: params,
  });
}

// 获取无节点部门用户
export function getNoOrganizationalList(params) {
  return fetch({
    url: '/usercenter/operation/organization/get',
    method: 'POST',
    data: params,
  });
}

// 新增角色
export function addRole(params) {
  return fetch({
    url: '/usercenter/router/role/addrole',
    method: 'POST',
    data: params,
  });
}

// 新增账号
export function addAccount(params) {
  return fetch({
    url: '/usercenter/operation/orgnazation/addAccount',
    method: 'POST',
    data: params,
  });
}

// 编辑用户账号
export function editUserAccount(params) {
  return fetch({
    url: '/usercenter/router/organization/edit',
    method: 'POST',
    data: params,
  });
}

// 获取课程列表
export function getCourceList(params) {
  return fetch({
    url: '/questionlib/nice/course/querycourse',
    method: 'POST',
    data: params,
  });
}
// 复制角色权限
export function copyPermissions(params) {
  return fetch({
    url: '/questionlib/nice/permission/duplicaterole',
    method: 'POST',
    data: params,
  });
}
// 根据课程ID获取期次
export function getPeriodByCouseId(params) {
  return fetch({
    url: '/questionlib/nice/period/getallperiodbycourseid',
    method: 'POST',
    data: params,
  });
}
// 获取所有辅导老师
export function getAllAutor(params) {
  return fetch({
    url: '/questionlib/nice/tutor/getalltutor',
    method: 'POST',
    data: params,
  });
}

// 分配权限
export function distributePermission(params) {
  return fetch({
    url: '/questionlib/nice/permission/distributepermission',
    method: 'POST',
    data: params,
  });
}

// 获取角色与权限的关系
export function getRoleAndPermission(params) {
  return fetch({
    url: '/questionlib/nice/roleAndPermission/list',
    method: 'POST',
    data: params,
  });
}

// 获取所有岗位
export function findEnumTreeByTableNameAndFieldName(params) {
  return fetch({
    url:
      '/usercenter/nice/treefromsingletable/findEnumTreeByTableNameAndFieldName',
    method: 'POST',
    data: params,
  });
}

// 新增岗位
export function addJobSubordinate(params) {
  return fetch({
    url: '/questionlib/nice/job/addSubordinate',
    method: 'POST',
    data: params,
  });
}

// 获取商品列表
export function getGoodsList(params) {
  return fetch({
    url: '/usercenter/operation/goods/getList',
    method: 'POST',
    data: params,
  });
}

// 根据商品中的课程获取期次
export function getPeriodListByCourseId(params) {
  return fetch({
    url: '/usercenter/operation/goods/getPeriodListByCourseId',
    method: 'POST',
    data: params,
  });
}
// 停止合作
export function setGradeCooperatingStatus(params) {
  return fetch({
    url: '/usercenter/operation/school/setGradeCooperatingStatus',
    method: 'POST',
    data: params,
  });
}
// 获取职位
export function operationschoolpositiongetTree(params) {
  return fetch({
    url: '/usercenter/operation/school/position/getTree',
    method: 'POST',
    data: params,
  });
}
// 添加职位
export function operationschoolpositionadd(params) {
  return fetch({
    url: '/usercenter/operation/school/position/add',
    method: 'POST',
    data: params,
  });
}
// 更新职位
export function operationschoolpositionupdate(params) {
  return fetch({
    url: '/usercenter/operation/school/position/update',
    method: 'POST',
    data: params,
  });
}
// 删除职位
export function operationschoolpositiondelete(params) {
  return fetch({
    url: '/usercenter/operation/school/position/delete',
    method: 'POST',
    data: params,
  });
}
// 职位上移
export function operationschoolpositionup(params) {
  return fetch({
    url: '/usercenter/operation/school/position/up',
    method: 'POST',
    data: params,
  });
}

// 职位下移
export function operationschoolpositiondown(params) {
  return fetch({
    url: '/usercenter/operation/school/position/down',
    method: 'POST',
    data: params,
  });
}
// 添加banner
export function adminschoolbanneradd(params) {
  return fetch({
    url: '/usercenter/admin/school/banner/add',
    method: 'POST',
    data: params,
  });
}
// 更新banner状态
export function adminschoolbannerupdateStatus(params) {
  return fetch({
    url: '/usercenter/admin/school/banner/updateStatus',
    method: 'POST',
    data: params,
  });
}
// banner排序
export function adminschoolbannersort(params) {
  return fetch({
    url: '/usercenter/admin/school/banner/sort',
    method: 'POST',
    data: params,
  });
}
// 删除Banner
export function adminschoolbannerdelete(params) {
  return fetch({
    url: '/usercenter/admin/school/banner/delete',
    method: 'POST',
    data: params,
  });
}
// 获取学校banner列表
export function adminschoolbannerlist(params) {
  return fetch({
    url: '/usercenter/admin/school/banner/list',
    method: 'POST',
    data: params,
  });
}
